<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/base.js"></script>
</head>
<body>
    <input id="content" type="text"/><br>
    <button onclick="onShowClick();">生成二维码</button><br>
    <img id="qrCodeImage" height="100px" width="100px" style="border-style: solid;border-color: #000000;border-width: 1px"/>

    <script>
        function onShowClick(){
            let url="http://localhost:9003/qf/file/qrCode";
            let method="post";
            let requestJson={};
            requestJson.content=document.getElementById("content").value;
            requestJson.width=200;
            requestJson.height=200;
            requestJson.codeColor="#ffffff";
            requestJson.bgColor="#000000";
            $.rest(method,url,requestJson,function(r){
                if(r.ok){
                    let base64=r.result.base64;
                    document.getElementById("qrCodeImage").src="data:image/jpeg;base64,"+base64;
                }
            });

        }

    </script>
</body>
</html>